/*路由守卫*/ 

import router from './index'
import store from '../store'


router.beforeEach((to, from, next)=>{
  // 进入首页
  if(to.path === '/home' && !store.state.location.geohash){
      next()
  }else if(to.path === '/profile/account'){ // 进入账号页面
    if(store.state.profile.isLogin){
      next()
    }else{
      next({path:'/login'})
    }
  }else{
    next()
  }
  
})